<template>
  <div>
    <template>
      <el-table
          border
          :data="tableData"
          style="width: 100%">
        <el-table-column
            prop="name"
            label="姓名">
        </el-table-column>
        <el-table-column
            prop="phonenumber"
            label="电话">
        </el-table-column>
        <el-table-column
            prop="address"
            label="地址">
        </el-table-column>
      </el-table>
    </template>


  </div>
</template>

<script>
export default {
  name: "userMGR",

  data() {
    return {
      tableData: [],
      dialogVisible: true,
      form: {
        name: "",
        phonenumber: "",
      }
    }
  },

  methods: {
    //http://127.0.0.1/sales/customers/
    //获取后端用户数据列表
    async getUserList() {
      var ret = await this.$axios.post('http://127.0.0.1/sales/customers/');
      console.log(ret)
      for (var i = 0; i < ret.data.length; i++) {
        this.tableData.push(ret.data[i].fields)
      }
      // debugger
      console.log(this.tableData)

    },

    visibalBox() {
      debugger
      this.dialogVisible = true;
    },

    handleClose() {
      this.$confirm('确认关闭？')
      {
      }
    }
  },

  created() {
    this.getUserList();
  }
}
</script>

<style scoped>

</style>